{% extends 'layout.html' %}

{% block content %}
    <div class="container">
        <div style="margin-bottom: 10px" class="clearfix">
            <a class="btn btn-success" href="/note/add/{{ book_id }}">
                <span class="glyphicon glyphicon-plus-sign" aria-hidden="true"></span>
                新建笔记
            </a>
        </div>

        <div style="margin-bottom: 10px" class="clearfix">
            <a class="btn btn-success" href="/notebook/">
                <span class="glyphicon glyphicon-plus-sign" aria-hidden="true"></span>
                返回笔记本列表
            </a>



        </div>
        <div class="panel panel-default">
            <!-- Default panel contents -->
            <div class="panel-heading">
                <span class="glyphicon glyphicon-th-list" aria-hidden="true"></span>
                笔记列表
            </div>

            <!-- Table -->
            <table class="table table-bordered">
                <thead>
                <tr>
                    <th>标题</th>
                    <th>创建时间</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                {% for obj in queryset %}
                    <tr>
                        <td><a href="/note/{{ obj.id }}/">{{ obj.title }}</a></td>
                        <td>{{ obj.create_time }}</td>
                        <td>
                            <a class="btn btn-primary btn-xs" href="/note/{{ obj.id }}/edit/">编辑</a>
                            <a class="btn btn-danger btn-xs" href="/note/{{ obj.id }}/delete/">删除</a>
                        </td>
                    </tr>
                {% endfor %}

                </tbody>
            </table>
        </div>
        <div class="clearfix">
            <ul class="pagination">
                {{ page_string }}
            </ul>

        </div>

    </div>
{% endblock %}
